| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

Public Member Functions | List of all members
nkGraphics::EntityRenderLodSlot Class Referencefinal

A LOD slot to potentially draw, within a group slot. More...

Inheritance diagram for nkGraphics::EntityRenderLodSlot:

## Public Member Functions
| EntityRenderLodSlot () noexcept
| EntityRenderLodSlot (Mesh *mesh, Shader *shader) noexcept
virtual | ~EntityRenderLodSlot ()
const BoundingBox & | getBounds () const
Mesh * | getMesh () const
Shader * | getShader () const
Shader * | getRaytracingShader () const
float | getQualityMetric () const
Shader * | getActiveShader () const
EntityRenderInfoSlot * | getParentSlot () const
Entity * | getParentEntity () const
void | setMesh (Mesh *value)
void | setShader (Shader *value)
void | setRaytracingShader (Shader *value)
void | setQualityMetric (float value)
void | setDirtyNodeTransform (bool value)
void | meshBoundsUpdated ()
void | meshLayoutUpdated ()
bool | isCompatibleWith (Shader *shade) const
void | updateActiveShader ()
virtual void | exportClassToTree (nkExport::Node *rootNode) override
virtual void | importClassFromTree (nkExport::Node *rootNode) override
Public Member Functions inherited from nkExport::Exportable
| Exportable () noexcept
virtual | ~Exportable ()

## Detailed Description

A LOD slot to potentially draw, within a group slot.

This represents the end point in the rendering information, linking a mesh to a shader. The default render strategy will select one LOD to render, using provided information.

## Constructor & Destructor Documentation

## ◆ EntityRenderLodSlot() [1/2]

nkGraphics::EntityRenderLodSlot::EntityRenderLodSlot | ( |  | ) |
| noexcept

Default constructor.

## ◆ EntityRenderLodSlot() [2/2]

nkGraphics::EntityRenderLodSlot::EntityRenderLodSlot | ( | Mesh * | mesh,
|  | Shader * | shader
| ) |  |
| noexcept

Legacy convenience constructor.

Parameters

  mesh | The mesh to use.
  shader | The shader to use.

## ◆ ~EntityRenderLodSlot()

virtual nkGraphics::EntityRenderLodSlot::~EntityRenderLodSlot | ( |  | ) |
| virtual

Destructor.

## Member Function Documentation

## ◆ getBounds()

const BoundingBox& nkGraphics::EntityRenderLodSlot::getBounds | ( |  | ) | const

Returns
  The LOD's bounds, mix between the mesh itself and the node attached to the parent entity, if any.

## ◆ getMesh()

Mesh* nkGraphics::EntityRenderLodSlot::getMesh | ( |  | ) | const

Returns
  The mesh attached.

## ◆ getShader()

Shader* nkGraphics::EntityRenderLodSlot::getShader | ( |  | ) | const

Returns
  The shader wanted, when used in a RenderScenePass.

Remarks
  This is the wanted shader for the LOD, which will be used or not depending on its compatibility with given mesh.

## ◆ getRaytracingShader()

Shader* nkGraphics::EntityRenderLodSlot::getRaytracingShader | ( |  | ) | const

Returns
  The raytracing shader used, when in a raytraced queue used in a RaytracingPass.

## ◆ getQualityMetric()

float nkGraphics::EntityRenderLodSlot::getQualityMetric | ( |  | ) | const

Returns
  The set quality metric.

## ◆ getActiveShader()

Shader* nkGraphics::EntityRenderLodSlot::getActiveShader | ( |  | ) | const

Returns
  The shader used, when used in a RenderScenePass.

Remarks
  This is the shader marked as active, which will actually be used during rendering. Depending on the compatibility between the wanted shader and the mesh attached, this will return either the wanted shader (if compatible), or one of the component's compatible built-in shaders.

## ◆ getParentSlot()

EntityRenderInfoSlot* nkGraphics::EntityRenderLodSlot::getParentSlot | ( |  | ) | const

Returns
  The parent slot.

## ◆ getParentEntity()

Entity* nkGraphics::EntityRenderLodSlot::getParentEntity | ( |  | ) | const

Returns
  The parent entity.

## ◆ setMesh()

void nkGraphics::EntityRenderLodSlot::setMesh | ( | Mesh * | value | ) |

Sets the mesh to use during rendering.

Parameters

  value | The mesh to use.

## ◆ setShader()

void nkGraphics::EntityRenderLodSlot::setShader | ( | Shader * | value | ) |

Sets the shader to use during a RenderScenePass. This shader will be used, or not, depending on its compatibility with linked mesh.

Parameters

  value | The shader to use.

## ◆ setRaytracingShader()

void nkGraphics::EntityRenderLodSlot::setRaytracingShader | ( | Shader * | value | ) |

Sets the shader to use during a RaytracingPass.

Parameters

  value | The shader to use.

## ◆ setQualityMetric()

void nkGraphics::EntityRenderLodSlot::setQualityMetric | ( | float | value | ) |

Sets the quality metric which can be used for LOD selection. This number can represent anything, but needs a meaning that can be interpreted by the RenderStrategy which will use it. For an exemple of how this could be interpreted, check the DefaultRenderStrategy.

Parameters

  value | The value to provide.

## ◆ setDirtyNodeTransform()

void nkGraphics::EntityRenderLodSlot::setDirtyNodeTransform | ( | bool | value | ) |

Sets the transformation dirty flag. Used internally.

## ◆ meshBoundsUpdated()

void nkGraphics::EntityRenderLodSlot::meshBoundsUpdated | ( |  | ) |

Notifies that the bounds have been udpated. Used internally.

## ◆ meshLayoutUpdated()

void nkGraphics::EntityRenderLodSlot::meshLayoutUpdated | ( |  | ) |

Notifies that the mesh's layout has been updated. Used internally.

## ◆ isCompatibleWith()

bool nkGraphics::EntityRenderLodSlot::isCompatibleWith | ( | Shader * | shade | ) | const

Parameters

  shade | The shader to test against.

Returns
  Whether the LOD, given its current state (its mesh currently), is compatible with the provided shader.

## ◆ updateActiveShader()

void nkGraphics::EntityRenderLodSlot::updateActiveShader | ( |  | ) |

Updates the active shader used by the LOD, based on the active mesh and requested shader. If the requested shader is not compatible with the active mesh, then a compatible built-in shader will be chosen as active instead.

## ◆ exportClassToTree()

virtual void nkGraphics::EntityRenderLodSlot::exportClassToTree | ( | nkExport::Node * | rootNode | ) |
| override virtual

Exports an item into a tree describing its structure and its data.

Parameters

  rootNode | The node into which the object has to write its related information.

Implements nkExport::Exportable.

## ◆ importClassFromTree()

virtual void nkGraphics::EntityRenderLodSlot::importClassFromTree | ( | nkExport::Node * | rootNode | ) |
| override virtual

Imports information from a tree which is supposed to describe its structure and data.

Parameters

  rootNode | The root node of the tree holding the information.

Implements nkExport::Exportable.

The documentation for this class was generated from the following file:

- Documentation/Headers/NilkinsGraphics/Entities/EntityRenderLodSlot.h